<template>
	<view>
		<uni-section>
			<view v-for="(item, index) in campusList" :key="item.id" :ref="'item'+index" @click="onClick(item.id)">
				<uni-card :title="item.campusName" :isFull="true" :sub-title="item.campusAddress" extra="查看详情" :thumbnail="item.campusImgs">
				</uni-card>
			</view>
		</uni-section>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				campusList:null,
			}
		},
		onLoad() {
			this.findAllCampus();
		},

		methods: {
			onClick(id) {
				uni.navigateTo({
					url: "./yiyuan_introduce?id=" + id,
					// url: "./details?id=" + e.id,

				})
			},
			findAllCampus() {

				this.$axios
					.post("http://localhost:9000/user/user/campus/findAllCampus")
					.then((response) => {
						this.campusList = response.data.data.list
					}) //请求成功
					.catch((error) => {
						console.log(error);
					}); //请求失败

			},
		}
	}
</script>

<style>

</style>
